﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="IFD2.Default" %>

<%--UID:czroot PWD:cz12Root --%>
<!DOCTYPE html>

<html> <!-- xmlns="http://www.w3.org/1999/xhtml"-->
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><%--, user-scalable=no--%>
    <title>NEO</title>

    <link href="Bootstrap/css/bootstrap-bootswatch.min.css" rel="stylesheet" />

    <link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
    <link rel="bookmark" href="images/favicon.ico" type="image/x-icon"/>
    <link rel="apple-touch-icon" sizes="57x57" href="images/apple-touch-icon-iphone.png" />
    <link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-ipad.png" />
    <link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-iphone4.png" />
    <style type="text/css">
        .form-group{width:70%;margin:0 auto;}
        @media only screen and (min-width: 768px) {
            .form-group{width:100%;}
        }
    </style>
</head>
<body>
    <div class="navbar navbar-inverse" style="border-radius:0px;">
        <div class="container">
            <div class="navbar-header navbar-right">
                &nbsp;&nbsp;&nbsp;&nbsp;<span id="lblUTCTime" style="font-size:large;color:white;position:relative;top:11px;"></span>
            </div>
        </div>
    </div>

    <div class="container">
        <div id="jumbotron" class="jumbotron">
            <div class="row">
                <div class="col-sm-1 col-md-1"></div>
                <div class="col-sm-6 col-md-7" style="color:#03376a;"><!--#03376a-->
                    <div class="form-group">
                        <span style="font-size:60px;font-weight:bold">NEO</span><sub style="font-size:small;">&nbsp;&trade;</sub>
                    </div>
                    <div class="form-group">
                        &nbsp;<asp:Label ID="lblVersion" runat="server" Text="(Testing)" meta:resourcekey="tipAlpha" Font-Bold="true"></asp:Label>
                    </div>
                    <br />
                    <div class="form-group">
                        <p class="lead" style="font-size:x-large;"><asp:Label ID="Label1" runat="server" Text="Light & Powerful" meta:resourcekey="tipSysInfo" Font-Italic="true" ></asp:Label><!--meta:resourcekey="tipSysInfo"--></p>
                    </div>
                </div>
                <div class="col-sm-4 col-md-3">
                    <form id="form1" runat="server" role="form" class="form" autocomplete="off">
                        <asp:Panel ID="Panel1" runat="server" DefaultButton="lbtnL_og_on">
                        <br />
                        <div class="form-group has-feedback">
                            <%--<asp:Label ID="lblUserID" runat="server" Text="User ID:" Visible="false" meta:resourcekey="tipUserID" ForeColor="#03376a" Font-Bold="true"></asp:Label>--%>
                            <!--div class="input-group"-->
                                <asp:TextBox ID="txtU_I_D" MaxLength="20" runat="server" CssClass="form-control" style="background-color:white;opacity:0.8;border:0;color:#03376a;" TabIndex="1"></asp:TextBox>
                                <div id="icon1"><%--  style="background-color:white;opacity:0.8;border:0;color:#aaaaaa;" --%><%--<span class="glyphicon glyphicon-user" aria-hidden="true"></span>--%></div>
                            <!--/div-->
                        </div>
                        <br /><br />
                        <div class="form-group has-feedback">
                            <%--<asp:Label ID="lblPwd" runat="server" Text="Password:" Visible="false" meta:resourcekey="tipPassword" ForeColor="#03376a" Font-Bold="true"></asp:Label>--%>
                            <!--div class="input-group"-->
                                <asp:TextBox ID="txtP_A_S_S" MaxLength="20" runat="server" style="opacity:0.8;" CssClass="form-control" BorderStyle="None" oninput="Shadow('txtP_A_S_S','hidP_A_S_S');" TabIndex="2" ForeColor="#03376a"></asp:TextBox><%-- onfocus="this.type='password'" --%>
                                <div id="icon2"><!--span class="glyphicon glyphicon-asterisk form-control-feedback" aria-hidden="true"></span--></div>
                                <%--浏览器记了密码后，管理员帐号是可以看到明码的！用https不会记密码，用flash也不会，但是有些浏览器插件仍旧会记表单！用hidden来转存/传输密码，则不会被浏览器记忆！--%>
                            <!--/div-->
                        </div>
                        <br /><br />
                        <div class="form-group">
                            <div class="input-group">
                                <asp:TextBox ID="txtCheckCode" MaxLength="6" runat="server" style="opacity:0.8;" CssClass="form-control" BorderStyle="None" TabIndex="3" ForeColor="#03376a"></asp:TextBox>
                                <div class="input-group-addon" style="background-color:white;opacity:0.8;border:0;">
                                    <div style="height:1px;position:relative;top:-12px;" onclick="refresh_img();">
                                        <img id="img_chk" src="img_chk.ashx" />
                                        <%--<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/img_chk.ashx" TabIndex="5" />--%>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <br /><br />
                        <div class="form-group">
                            <asp:LinkButton ID="lbtnL_og_on" runat="server" style="opacity:0.8;" CssClass="form-control btn btn-primary" OnClick="lbtnL_og_on_Click" TabIndex="4" >
                                <span id="play_button" class="glyphicon glyphicon-play" style="font-size:x-large;position:relative;top:-3px;"></span>
                                <%--<img src="images/l-og-in.png"  style="position:relative;top:-3px;"/>--%>
                            </asp:LinkButton>
                        </div>
                        <asp:Label ID="lblError" runat="server" Text="" CssClass="ifdMessage" ForeColor="Blue" BackColor="White"></asp:Label>
                        <asp:HiddenField ID="hidCulture" runat="server" />
                        <asp:HiddenField ID="hidP_A_S_S" runat="server" />
                        <asp:HiddenField ID="hidAgent" runat="server" />
                        </asp:Panel>
                    </form>
                </div>
                <div class="col-sm-1 col-md-1"></div>
            </div>
        </div>
        
        <div class="row">
            <div class="col-sm-6">
                <h4><asp:Label ID="Label4" runat="server" Text="News" meta:resourcekey="tipBrief"></asp:Label></h4>
                <asp:Literal ID="litBrief" runat="server" Text=""></asp:Literal>
                <%--a class="btn btn-default" href="http://go.microsoft.com/fwlink/?LinkId=301948">More... &raquo;</a--%>
            </div>
            <div class="col-sm-6">
                <h4><asp:Label ID="Label5" runat="server" Text="Contact" meta:resourcekey="Contact"></asp:Label></h4>
                <asp:Literal ID="Literal1" runat="server" Text="ContactDetails" meta:resourcekey="ContactDetails"></asp:Literal>
            </div>
        </div>
    </div>
    <hr />

    <%--为显示不受客户端时间影响的Server端UTC时间--%>
    <asp:Label ID="lblUTC" runat="server" Text="" style="display:none"></asp:Label>
    <input id="hidLoadTime" type="hidden" />

    <footer>
    <p style="text-align:center;">&copy; <%: DateTime.Now.Year %>&nbsp; <asp:Label ID="Label8" runat="server" Text="by BD7NXY" meta:resourcekey="tipCompanyName"></asp:Label></p>
    </footer>
    
    <!-- JS placed at the end of the document so the pages load faster -->
    <script src="Jquery/jquery.min.js"></script>
    <script src="Bootstrap/js/bootstrap.min.js"></script>
    <script src="js/shadow.min.js"></script>
    <script src="js/Date2Str.min.js"></script>
    <script> 
        window.onload = function () {
            <%--document.getElementById('form1').autocomplete = "off";//too late?--%>
            <%--//为显示不受客户端时间影响的Server端UTC时间--%>
            var now = new Date();
            document.getElementById('hidLoadTime').value = now.toString();
            show_time();
            window.setInterval("show_time()", 1000);//ms

            <%--if (!IsPostBack){--%>
                var element = null;
                element = document.createElement("span");
                element.setAttribute("class", "gl" + "yphicon gl" + "yphicon-" + "u" + "ser" + " form-control-feedback");
                element.setAttribute("aria-hidden", "true");
                element.setAttribute("style", "color:gray;");
                var loca = document.getElementById("icon1");
                loca.appendChild(element);
                element = null;
                element = document.createElement("span");
                element.setAttribute("class", "gl" + "yphicon gl" + "yphicon-" + "lo" + "ck" + " form-control-feedback");
                element.setAttribute("aria-hidden", "true");
                element.setAttribute("style", "color:gray;");
                var loca = document.getElementById("icon2");
                loca.appendChild(element);
            <%--}--%>
            <%--document.getElementById('txtP_A_S_S').value = '';//避免浏览器记住密码，立即清除自动填入的密码！--%>
            
            <% if (IsPostBack) { %>
                document.getElementById('txtP_A_S_S').focus();
            <% } else { %>
                document.getElementById('txtU_I_D').focus();
            <% } %>

            var bg_style = '#e0e0e0 url(images/face' + Math.floor(Math.random() * (9 + 1)) + '.jpg) no-repeat top center';
            document.getElementById('jumbotron').style.background = bg_style;

            <% if (Application["DEBUG"]!=null && Application["DEBUG"].ToString() == "1") { %>
                document.getElementById('txtU_I_D').style.color = 'green';
                document.getElementById('txtP_A_S_S').style.color = 'green';
                document.getElementById('txtCheckCode').style.color = 'green';
                document.getElementById('play_button').style.color = 'lightgreen';
            <% } %>
        };

        <%--//document.getElementById('lblError').innerText = window.navigator.userAgent;//different from Request.UserAgent in asp.net?--%>

        function show_time() {
            var ServerUTC;
            if (typeof (document.getElementById('lblUTC').innerText) == 'undefined')//firefox
                ServerUTC = document.getElementById('lblUTC').textContent;
            else
                ServerUTC = document.getElementById('lblUTC').innerText;
            if (ServerUTC.length > 0)
            {
                var now = new Date();
                var load_utc = new Date(ServerUTC);
                var passed_ms = parseInt(now.getTime() - new Date(document.getElementById('hidLoadTime').value).getTime());
                <%--//由于更新周期是5000ms，+2500ms后整分钟显示的误差为正负2.5秒，而不是0~5秒。忽略hidLoadTime与lblUTC的误差--%>
                var now_utc = new Date(load_utc.getTime() + passed_ms + 500);
                if (typeof (document.getElementById('lblUTC').innerText) == 'undefined')//firefox
                    document.getElementById('lblUTCTime').textContent = date2str(now_utc, "yyyy/M/d h:mm:ss") + " UTC";
                else{
                    document.getElementById('lblUTCTime').innerText = '';<%--不清空Safari显示异常--%>
                    document.getElementById('lblUTCTime').innerText = date2str(now_utc, "yyyy/M/d h:mm:ss") + " UTC";
                }
            }
        }

        function refresh_img()
        {
            document.getElementById('img_chk').src = 'img_chk.ashx?rnd='+Math.random();
            document.getElementById('txtCheckCode').value = '';
            document.getElementById('txtCheckCode').focus();
        }
    </script>
</body>
</html>
